﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Reflection;
using Pixysoft.Weblications.Sango.Dao;
using Pixysoft.Weblications.Sango.Constant;
using Pixysoft.Weblications.Sango.Formular;
using Pixysoft.Weblications.Sango.Environment;

namespace Pixysoft.Weblications.Sango.Command.strategy
{
    partial class SangoStrategyHandler
    {
        public strategy_upgradecooldowninfo strategy_upgradecooldowninfo()
        {
            string usercode = SangoManager.Authentication();

            strategy_upgradecooldowninfo response = ReflectionManager.CreatePojo<strategy_upgradecooldowninfo>();
            response.Succeed = false;

            Entities.Usr_Queue usrQueue = UsrQueueDao.getRunningQueue(usercode, CtiQueueTypecodeCollection.TECH_UPGRADE, usercode);

            if (usrQueue == null)
            {
                response.Message = "无冷却队列";
                return response;
            }

            Entities.Sys_Queue sysQueue = SysQueueHelper.searchByCode(usrQueue.Queueserialcode);
            response.gold = (QueueFormular.getQueueCooldownGoldPrice(usrQueue, sysQueue));
            response.Succeed = true;
            return response;
        }
    }

    public interface strategy_upgradecooldowninfo : ISangoResponse
    {
        long gold { get;set;}
    }
}
